﻿<!DOCTYPE HTML>
<html xmlns:th="http://www.thymeleaf.org">
<head>
    <div th:include="admin/common :: head"></div>
    <link rel="stylesheet" type="text/css" href="/static/lib/webuploader/0.1.5/webuploader.css">
    <link rel="stylesheet" type="text/css" href="/static/css/admin/car/edit.css">
    <title>车辆编辑 - 车辆管理 </title>
</head>
<body>

<article class="page-container">
    <form id="form-car-add" class="form form-horizontal">
        <input th:value="${id}" name="id" type="hidden"/>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>标题：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.title}" type="text" class="input-text" value="" placeholder="请输入标题" required>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>品牌：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select id="car_brand" class="select" name="brandId" size="1">
                        <option selected="selected" th:value="${car.brandId}" th:text="${car.brand}"></option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>系列：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select id="car_series" class="select" name="seriesId" size="1">
                        <option th:each="ser:${series}"
                                th:value="${ser.id}" th:text="${ser.name}"
                                th:selected="${car.seriesId==ser.id}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>价格：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.price}" name="price" style="width: 150px" type="number" class="input-text" placeholder="请输入价格(元)" required>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>座位数：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.seats}" name="seats" style="width: 150px" type="number" class="input-text" placeholder="请输入座位数">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排量：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.displacement}" name="displacement" style="width: 150px" type="number" class="input-text" placeholder="请输入排量(L)">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>里程：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.mileage}" name="mileage" style="width: 150px" type="number" class="input-text" placeholder="请输入里程(km)">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>车龄：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.age}" name="age" style="width: 150px" type="number" class="input-text" placeholder="请输入车龄">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>变速箱：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select class="select" name="gearBox" size="1">
                        <option></option>
                        <option th:each="gearBox:${gearBoxs}"
                                th:value="${gearBox.code}" th:text="${gearBox.name}"
                                th:selected="${car.gearBox==gearBox.code}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>颜色：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select class="select" name="color" size="1">
                        <option></option>
                        <option th:each="color:${colors}"
                                th:value="${color.code}" th:text="${color.name}" th:color="${color.hex}"
                                th:selected="${car.color==color.code}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>驱动：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select class="select" name="driveType" size="1">
                        <option></option>
                        <option th:each="driveType:${driveTypes}"
                                th:value="${driveType.code}" th:text="${driveType.name}"
                                th:selected="${car.driveType==driveType.code}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>排放标准：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select class="select" name="emissionStandard" size="1">
                        <option></option>
                        <option th:each="emissionStandard:${emissionStandards}"
                                th:value="${emissionStandard.code}" th:text="${emissionStandard.name}"
                                th:selected="${car.emissionStandard==emissionStandard.code}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>车型：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select class="select" name="style" size="1">
                        <option></option>
                        <option th:each="style:${styles}"
                                th:value="${style.code}" th:text="${style.name}"
                                th:selected="${car.style==style.code}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>燃油类型：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select class="select" name="fuelType" size="1">
                        <option></option>
                        <option th:each="fuelType:${fuelTypes}"
                                th:value="${fuelType.code}" th:text="${fuelType.name}"
                                th:selected="${car.fuelType==fuelType.code}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>城市：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select id="car_city" class="select" name="cityId" size="1">
                        <option selected="selected" th:value="${car.cityId}" th:text="${car.cityCnName}"></option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>区域：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <span class="select-box" style="width:150px;">
                    <select id="car_region" class="select" name="regionId" size="1">
                        <option th:each="region:${regions}"
                                th:value="${region.id}" th:text="${region.cnName}"
                                th:selected="${car.regionId==region.id}">
                        </option>
                    </select>
			    </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>详细地址：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <input th:value="${car.address}" name="address" type="text" class="input-text" value="" placeholder="请输入详细地址">
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">标签：</label>
            <div id="tags" class="formControls col-xs-8 col-sm-9">
                <span class="label label-default"
                      th:each="tag : ${allTags}"
                      th:text="${tag.name}">
                </span>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2">描述：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <textarea th:text="${car.description}" name="description" cols="" rows="" class="textarea" placeholder="说点什么...100个字符以内" dragonfly="true"
                          onKeyUp="$.Huitextarealength(this,100)"></textarea>
                <p class="textarea-numberbar"><em class="textarea-length">0</em>/100</p>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>图片：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div class="uploader-list-container">
                    <div class="queueList">
                        <div id="dndArea" class="placeholder">
                            <div id="filePicker-2"></div>
                            <p>或将照片拖到这里，单次最多可选5张</p>
                        </div>
                    </div>
                    <div class="statusBar" style="display:none;">
                        <div class="progress"><span class="text">0%</span> <span class="percentage"></span></div>
                        <div class="info"></div>
                        <div class="btns">
                            <div id="filePicker2"></div>
                            <div class="uploadBtn">开始上传</div>
                        </div>
                    </div>
                </div>
            </div>
        </div>

        <div class="row cl">
            <label class="form-label col-xs-4 col-sm-2"><span class="c-red">*</span>封面：</label>
            <div class="formControls col-xs-8 col-sm-9">
                <div id="upload-cover-container">
                    <!-- 封面列表 -->
                    <span class="cover-desc">请先上传图片，从中选择封面</span>
                </div>
                <!--<input id="cover" type="hidden" value=""/>-->
            </div>
        </div>

        <div class="upload-photo-ids-container">
            <!--这里放上传OK图片的信息 在表单中一起上传-->
        </div>

        <div class="row cl">
            <div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-2">
                <input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
            </div>
        </div>
    </form>
</article>

<!--_footer 作为公共模版分离出去-->
<script type="text/javascript" src="/static/lib/jquery/1.9.1/jquery.min.js"></script>
<script type="text/javascript" src="/static/lib/layer/2.4/layer.js"></script>
<script type="text/javascript" src="/static/lib/h-ui/js/H-ui.min.js"></script>
<script type="text/javascript" src="/static/lib/h-ui.admin/js/H-ui.admin.js"></script>
<!--/_footer 作为公共模版分离出去-->

<!--请在下方写此页面业务相关的脚本-->
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/jquery.validate.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/validate-methods.js"></script>
<script type="text/javascript" src="/static/lib/jquery.validation/1.14.0/messages_zh.js"></script>
<script type="text/javascript" src="/static/lib/webuploader/0.1.5/webuploader.min.js"></script>


<script type="text/javascript" src="/static/js/admin/upload.js"></script>
<script type="text/javascript" src="/static/js/admin/car/edit.js"></script>

</body>
</html>